<div id="grid" class="table-wrap mt10 ml25" style="min-height: 200px;">

    <table width="100%">
        <thead>
        <tr>
            <th width="40">序号</th>
            <th width="80" class="align-m">业绩核算时间</th>
            <th width="80">合同属性</th>
            <th width="80">是否Saas</th>
            <th width="140" class="align-r">签约业绩分摊金额（元）</th>
            <th width="140" class="align-r">回款业绩分摊金额（元）</th>
            <th width="140" class="align-r">结算业绩分摊金额（元）</th>
            <th class="align-r">业绩归属人</th>
            <th width="80" class="align-l">业绩归属所属部门</th>
            <th width="140" class="align-l">业绩归属所属区域</th>
            <th width="80" class="align-m" ng-if="userAuthList.indexOf('0001') !== -1 && isEditMode">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="category in categories">
            <td height="40">
                <p>{{ $index + 1 }}</p>
            </td>
            <td class="align-m" style="white-space: nowrap">
                {{category.establish_time | date: "yyyy-MM-dd"}}
            </td>
            <td class="lh14">
                <input select2 ng-model="category.contract_type"
                       config="ddlConfigContractType" class="form-control" type="text"
                       required name="contract_type" ng-disabled="userAuthList.indexOf('0001') !== -1 && !isEditMode"/>
            </td>
            <td class="lh14">
                <input select2 ng-model="category.is_saas"
                       config="ddlConfigSaas" class="form-control" type="text"
                       required name="is_saas" ng-disabled="userAuthList.indexOf('0001') !== -1 && !isEditMode"/>
            </td>
            <td class="align-r">
                <input type="number" ng-model="category.sign_average_amount"
                       style="height: 30px;text-align: right;" ng-disabled="userAuthList.indexOf('0001') !== -1 && !isEditMode">
            </td>
            <td class="align-r">
                <input type="number" ng-model="category.receivable_average_amount"
                       style="height: 30px;text-align: right;" ng-disabled="userAuthList.indexOf('0001') !== -1 && !isEditMode">
            </td>
            <td class="align-r">
                <input type="number" ng-model="category.settlement_average_amount"
                       style="height: 30px;text-align: right;" ng-disabled="userAuthList.indexOf('0001') !== -1 && !isEditMode">
            </td>
            <td class="align-r">
                <input select2 name="user_id" ng-model="category.user_id"
                       config="ddlConfigContractSigner(category)" class="form-control" type="text"
                       style="margin-top: -4px;" ng-disabled="userAuthList.indexOf('0001') !== -1 && !isEditMode"/>
            </td>
            <td class="align-l">
                <p ng-bind="category.department_name"></p>
            </td>
            <td class="align-l">
                <p ng-bind="category.area_name"></p>
            </td>
            <td class="align-m" ng-if="userAuthList.indexOf('0001') !== -1 && isEditMode">
                <div>
                    <a href="javascript:;" ng-click="addCategory(category)">拆分</a>
                    <a href="javascript:void(0)" ng-click="deleteCategory(category)">删除</a>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
    <div class="no-data" style="display:none"><span>暂无数据</span></div>

</div>